//
//  main.m
//  重写机制
//
//  Created by mir_yan on 2018/9/28.
//  Copyright © 2018年 hakeem. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Person.h"
#import "Student.h"
int main(int argc, const char * argv[]) {
    @autoreleasepool {
        
        Person* p1 = [[Person alloc] init];
        /**
            alloc 分配内存
            init 初始化内存 并返回完成内存的地址
         */
        Student* s1 = [[Student alloc] init];
        
        Student* s2 = [[Student alloc] initWithName: @"小号" age: 123];
        
        s1.name = @"小米";
        
        NSLog(@"%@", s1);
        NSLog(@"%@", s2);
        
        [p1 haveMeeting];
        [s1 haveMeeting];

        [s1 play];
        
        [s1 goShop];
        NSLog(@"Hello, World!");
    }
    return 0;
}
